/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.service.impl;

import cc.altius.dao.ZoneDao;
import cc.altius.model.AppZone;
import cc.altius.model.City;
import cc.altius.model.MasterZone;
import cc.altius.model.Zone;
import cc.altius.service.ZoneService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author santosh
 */
@Service
public class ZoneServiceImpl implements ZoneService{
    @Autowired
    private ZoneDao zoneDao;

    @Override
    public List<City> getCityList() {
        return this.zoneDao.getCityList();
    }

    @Override
    public int addMasterZone(MasterZone masterZone) {
        return this.zoneDao.addMasterZone(masterZone);
    }

    @Override
    public List<MasterZone> getMasterZoneList() {
        return this.zoneDao.getMasterZoneList();
    }

    @Override
    public int updateMasterZone(MasterZone masterZone) {
        return this.zoneDao.updateMasterZone(masterZone);
    }

    @Override
    public MasterZone getMasterZoneById(int masterZoneId) {
        return this.zoneDao.getMasterZoneById(masterZoneId);
    }

    @Override
    public int addZone(Zone zone) {
        return this.zoneDao.addZone(zone);
    }

    @Override
    public List<Zone> getZoneList() {
        return this.zoneDao.getZoneList();
    }

    @Override
    public Zone getZoneById(int zoneId) {
        return this.zoneDao.getZoneById(zoneId);
    }

    @Override
    public int updateZone(Zone zone) {
        return this.zoneDao.updateZone(zone);
    }

    @Override
    public List<Zone> listZoneForAutocomplete(String zoneName) {
        return this.zoneDao.listZoneForAutocomplete(zoneName);
    }

    @Override
    public List<Map<String, Object>> getFilterMasterZone(int stateId, int cityId) {
        return this.zoneDao.getFilterMasterZone(stateId, cityId);
    }

    @Override
    public List<Map<String, Object>> getFilterZone(int stateId, int cityId, int masterZoneId) {
        return this.zoneDao.getFilterZone(stateId, cityId, masterZoneId);
    }

    @Override
    public boolean existZoneByZoneName(String zoneName,String zoneCode) {
        if(this.zoneDao.getZoneByZoneName(zoneName,zoneCode)==null){
        return false;
        }else{
        return true;
        }
    }

    @Override
    public boolean existMasterZoneByMasterZoneCode(String masterZoneCode) {
        if(this.zoneDao.getMasterZoneByMasterZoneCode(masterZoneCode) ==null){
        return false;
        }else{
        return true;
        }
    }

    @Override
    public List<AppZone> getAppZoneList() {
        return this.zoneDao.getAppZoneList();
    }
}
